var textCount=(function () {
    var _bind=function (that) {
        that.input.on('keyup',function () {
            that.render();
        })
    };
    var _getNum=function (that) {
        return that.input.val().length;
    };
    var textCountFun=function () {
    };
    textCountFun.prototype.init=function (config) {
       this.input=$(config.id);
       _bind(this);
       return this;
    };
    textCountFun.prototype.render=function () {
      var num=_getNum(this),$inputNum=$('#input-num');
      if($inputNum.length===0){
          $inputNum=$('<span id="input-num"></span>')
      }
      $inputNum.html(num);
      this.input.after($inputNum);
    };
    return textCountFun;
})();
$(function () {
    new textCount().init({id:'#app'}).render();
});